﻿using System;
using System.Web.Mvc;
using Mailias.UI.Web;
using Mailias.UI.Web.Models;

namespace Mailias.UI.Web.Controllers
{
    public class HomeController : BaseDocumentStoreController
    {
        public ActionResult Index()
        {
            var model = HomeIndexViewModel.Create(this.DocumentSession);
            model.ServerName = Server.MachineName;
            try
            {
                model.Hostname = Request.Url.DnsSafeHost;
                model.IsNotConfigured = string.IsNullOrEmpty(ViewBag.Address);
            }
            catch(Exception){}

            return View(model);
        }

        public ActionResult About()
        {
            return View();
        }
    }
}
